<?php

class Application_Form_Formatfeuille extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	$Nom = new Zend_Form_Element_Text('Nom');
    	$Nom->setRequired(true);
    	$Nom->setLabel('Nom');
    	
    	$valid = new Zend_Form_Element_Text('valid');
    	$valid->setRequired(true);
    	$valid->setLabel('Validateur');
    	
    	
    	$Type = new Zend_Form_Element_Text('Type');
    	$Type->setRequired(true);
    	$Type->setLabel('Type');
    	 
    	
    	
    	$pere = new Zend_Form_Element_Select('pere');
    	 
    	$pere->setLabel("Colonne principale");
    	 
    	$idfeuille=Zend_Controller_Front::getInstance()->getRequest()->getParam("id");
    	$perereg=new Application_Model_DbTable_Formatfichier();
    	$pere->addMultiOption("","");
    	$list =$perereg->fetchAll("idfeuilles = $idfeuille")->toArray();
    	foreach($list as $key => $value){
    		$pere->addMultiOption($value['idformatfichier'],$value['colname']);
    		 
    	} 
    	 
    	
    	$sendBt = new Zend_Form_Element_Submit('submit');
    	$sendBt->setLabel('Enregistrer');
    	
    	
    	$this->addElements(array($Nom,$valid,$pere,$Type,$sendBt));
    }


}

